<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', 'StaticPagesController@home');
Route::get('/home', 'StaticPagesController@home')->name('home');
Route::get('/help','StaticPagesController@help')->name('help');
Route::get('/about','StaticPagesController@about')->name('about');
Auth::routes();

Auth::routes(['verify'=>true]);


Route::resource('users','UserController');
Route::resource('posts','PostController',['only'=>['index','create','store','update','edit','destroy']]);
Route::get('posts/{post}/{slug?}','PostController@show')->name('posts.show');
Route::post('users/follows/{user}','FollowsController@store')->name('follow');
Route::delete('users/follows/{user}','FollowsController@destroy')->name('unfollow');

Route::post('posts/comment','CommentsController@store')->name('posts.comment');
Route::resource('/admin','AdminController',['middleware' => ['role:super-admin']]);
Route::resource('image','ImageController');
Route::resource('files','FileController',['only'=>['store']]);
Route::get('files','FileController@index')->name('files.index');
Route::get('files/download','FileController@download')->name('files.download');